package 笔试;

import java.util.Scanner;

public class 神奇字符 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        scan.nextLine();
        String str = scan.nextLine();
        String art = scan.nextLine();
        String[] nums = new String[n-m+1];
        for (int i = 0; i < nums.length; i++) {
            StringBuilder sb = new StringBuilder();
            for (int j = i; j < i+m; j++) {
                sb.append(str.charAt(j));
            }
            nums[i] = sb.toString();
        }
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            int j = 0;
            while(j < m) {
                if(nums[i].charAt(j) == art.charAt(j) || art.charAt(j) == '*') {
                    j++;
                } else {
                    break;
                }
            }
            if(j < m) {
                continue;
            } else {
                count++;
            }
        }
        System.out.println(count);
//        System.out.println(n);
//        System.out.println(m);
//        System.out.println(str);
//        System.out.println(art);
    }
}
